import { defineConfig, presetAttributify, presetIcons, presetUno } from 'unocss';
import transformVariantGroup from '@unocss/transformer-variant-group';

export default defineConfig({
  // 预设
  presets: [
    presetUno(),
    presetAttributify(),
    presetIcons({
      scale: 1.2,
      warn: true
    })
  ],
  // 转换器
  transformers: [transformVariantGroup()],

  // 规则
  rules: [
    // 自定义规则
  ],

  // 快捷方式
  shortcuts: [
    // 自定义快捷方式
    {
      'flex-center': 'flex justify-center items-center',
      'flex-col-center': 'flex flex-col justify-center items-center',
      'absolute-center': 'absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2'
    }
  ],

  // 主题
  theme: {
    colors: {
      // 自定义颜色
      primary: 'var(--el-color-primary)',
      success: 'var(--el-color-success)',
      warning: 'var(--el-color-warning)',
      danger: 'var(--el-color-danger)',
      info: 'var(--el-color-info)'
    }
  },

  // 变体
  variants: [
    // 自定义变体
  ],

  // 层级
  layers: {
    components: -1,
    default: 1,
    utilities: 2
  }
});
